package cn.tianyigps.m7.utils;


import cn.tianyigps.m7.template.JedisTemplate;

import java.io.IOException;
import java.util.Properties;

/**
 * Created with IDEA
 *
 * @description:
 * @author: cui.guibin
 * @create: 2019/4/2 15:40
 **/
public class PropertiesUtil {

    private static Properties PROP = new Properties();

    public static Integer getInt(String index,String source){
        try {
            PROP.load(JedisTemplate.class.getClassLoader().getResourceAsStream(source));
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
        String s = PROP.getProperty(index);
        return (null == s || "".equals(s)) ? null:new Integer(s);
    }

    public static String getStr(String index,String source){
        try {
            PROP.load(JedisTemplate.class.getClassLoader().getResourceAsStream(source));
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
         return PROP.getProperty(index);
    }



}
